package com.google.code.swingonfire.showcase.utils;

import java.io.File;
import java.util.EventListener;

import com.google.code.swingonfire.component.JFileField;

public class FileParameterDefinition extends AbstractParameterDefinition<JFileField, File>
{

    public FileParameterDefinition(String name)
    {
        super(name, File.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JFileField createComponent(EventListener eventListener)
    {
        return new JFileField();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public File getValue(JFileField component)
    {
        return component.getFile();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setValue(JFileField component, File value)
    {
        component.setFile(value);
    }

}
